All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.java.swing.text.StyledEditorKit
java.lang.Object
|
+----com.sun.java.swing.text.EditorKit
|
+----com.sun.java.swing.text.DefaultEditorKit
|
+----com.sun.java.swing.text.StyledEditorKit
- public class StyledEditorKit
- extends DefaultEditorKit
This is the set of things needed by a text component
to be a reasonably functioning editor for some type
of text document. This implementation provides a default
implementation which treats text as styled text and
provides a minimal set of actions for editing styled text.
-
StyledEditorKit()
-
-
clone()
- Create a copy of the editor kit.
-
createDefaultDocument()
- Creates an uninitialized text storage model
that is appropriate for this type of editor.
-
deinstall(JEditorPane)
- Called when the kit is being removed from the
JEditorPane.
-
getActions()
- Fetches the command list for the editor.
-
getCharacterAttributeRun()
- Fetches the element representing the current
run of character attributes for the caret.
-
getInputAttributes()
- Gets the input attributes for the pane.
-
getViewFactory()
- Fetches a factory that is suitable for producing
views of any models that are produced by this
kit.
-
install(JEditorPane)
- Called when the kit is being installed into
a JEditorPane.
StyledEditorKit
public StyledEditorKit()
getInputAttributes
public MutableAttributeSet getInputAttributes()
- Gets the input attributes for the pane. When
the caret moves and there is no selection, the
input attributes are automatically mutated to
reflect the character attributes of the current
caret location. The styled editing actions
use the input attributes to carry out their
actions.
- Returns:
- the attribute set
getCharacterAttributeRun
public Element getCharacterAttributeRun()
- Fetches the element representing the current
run of character attributes for the caret.
- Returns:
- the element
clone
public Object clone()
- Create a copy of the editor kit. This
allows an implementation to serve as a prototype
for others, so that they can be quickly created.
- Returns:
- the copy
- Overrides:
- clone in class DefaultEditorKit
getActions
public Action[] getActions()
- Fetches the command list for the editor. This is
the list of commands supported by the superclass
augmented by the collection of commands defined
locally for style operations.
- Returns:
- the command list
- Overrides:
- getActions in class DefaultEditorKit
createDefaultDocument
public Document createDefaultDocument()
- Creates an uninitialized text storage model
that is appropriate for this type of editor.
- Returns:
- the model
- Overrides:
- createDefaultDocument in class DefaultEditorKit
install
public void install(JEditorPane c)
- Called when the kit is being installed into
a JEditorPane.
- Parameters:
- c - the JEditorPane
- Overrides:
- install in class EditorKit
deinstall
public void deinstall(JEditorPane c)
- Called when the kit is being removed from the
JEditorPane. This is used to unregister any
listeners that were attached.
- Parameters:
- c - the JEditorPane
- Overrides:
- deinstall in class EditorKit
getViewFactory
public ViewFactory getViewFactory()
- Fetches a factory that is suitable for producing
views of any models that are produced by this
kit. This is implemented to return View implementations
for the following kinds of elements:
- AbstractDocument.ContentElementName
- AbstractDocument.ParagraphElementName
- AbstractDocument.SectionElementName
- StyleConstants.ComponentElementName
- StyleConstants.IconElementName
- Returns:
- the factory
- Overrides:
- getViewFactory in class DefaultEditorKit
All Packages Class Hierarchy This Package Previous Next Index